//p70/457
//Cach gan reference variable rat hay;

package session2.polymorphism;
import session2.GameShape;
public class PlayerPiece extends GameShape implements Animatable {
	public PlayerPiece() {
	}

	// @Override method of Animatable interface;
	public void animate() {
		System.out.println("PlayerPiece.java: animate()");
	}

	// @Override method of GameShape class;
	public void displayShape() {
		super.displayShape();
	}

	public void movePiece() {
		System.out.println("PlayerPiece.java: movePiece()");
	}

	public static void main(String[] args) {
		PlayerPiece player = new PlayerPiece();
		player.displayShape();
//		o variable ko the reference cac method duoc;
		Object o = player;
		
//		GameShape la father (super class), trong do player la object of PlayerPiece
		GameShape shape = player;		
		shape.displayShape();
		
//		Do Animatable la interface->co the tao instance duoc;
		Animatable mover = player;
		mover.animate();
		
//		KL:
//		Chi co 1 object o day (instance of type PlayerPiece) nhung co toi 
//		4 reference variable, tat ca de tro toi object player (nam trong heap) 	
	}
}